import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import "./icons";
import "./plugins/element.js";
import store from "./store";
import "@/styles/index.scss"; // global css
import i18n from "./lang"; // Internationalization
import * as filters from "./filters"; // 全局过滤器
import { queryData } from "./api/index.js"; //封装aiox
import defaultSetting from "./settings"; //全局基础项目配置

import isMock from "./mock"; // 引入mock
defaultSetting.mock && isMock(); //是否使用mock数据

// 全局挂载挂载http
Vue.prototype.$http = queryData;

Vue.config.productionTip = false;

// 全局注册 filters过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount("#app");
